package test;

import java.util.ArrayList;
import java.util.Arrays;

public class test {
    public static void main(String[] args) {
        var staff = new Employee[4];
        staff[0] = new Employee("Carl Cracker", 75000, 1987, 12, 15);
        staff[1] = new Employee("Harry Hacker", 50000, 1989, 10, 1);
        staff[2] = new Employee("Tony Tester", 40000, 1990, 3, 15);


        Employee sy = new Employee("sy", 1000000, 2003, 3, 22);
        staff[0] = sy;


//        Arrays.sort(staff);
        for (Employee e : staff) {
            if (e != null) {
                System.out.println(e.getName() + e.getSalary());
            }
        }


//        var staff = new ArrayList<Employee>();
//        staff.add(new Employee("Carl Cracker", 75000, 1987, 12, 15));
//        staff.add(new Employee("Harry Hacker", 50000, 1989, 10, 1));
//        staff.add(new Employee("Tony Tester", 40000, 1990, 3, 15));
//
//        var lst = new Employee[staff.size()];
//        staff.toArray(lst);
//        System.out.println(staff);
//        System.out.println(Arrays.toString(lst));
//        for(Employee a:staff){
//            System.out.println(a);
//        }
    }
}